import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

import Layout from '../views/layout/Layout'


export const constantRouterMap = [{
    path: '/404',
    component: () =>
      import('@/views/404'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    name: 'home',
    children: [{
      meta: {
        title: '酒店首页',
        icon: 'home'
      },
      path: 'home',
      component: () =>
        import('@/views/home/index')
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/advertisementData',
    name: 'advertisementData',
    meta: {
      title: '广告数据',
      icon: 'STATISTICS'
    },
    children: [{
      meta: {
        title: '广告数据',
        icon: 'STATISTICS'
      },
      path: '/advertisementData',
      component: () =>
        import('@/views/advertisement/data')
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/hotelRevenue',
    name: 'hotelRevenue',
    meta: {
      title: '酒店收益',
      icon: 'money'
    },
    children: [{
      path: '/hotelRevenue',
      component: () =>
        import('@/views/hotel/revenue'),
      meta: {
        title: '酒店收益',
        icon: 'money'
      },
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/terminalManagement',
    name: 'terminalManagement',
    meta: {
      title: '终端管理',
      icon: 'settings'
    },
    children: [{
      path: '/terminalManagement',
      component: () =>
        import('@/views/terminal/management'),
      meta: {
        title: '终端管理',
        icon: 'settings'
      },
    }]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

export default new Router({
  // mode: 'history', //hash
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRouterMap

})
